Page({
  data: {
    detailList: {}
  },
  onLoad ({ id }) {
    this.getDetail(id)
    console.log(id)
  },
  //获取详情
  async getDetail (id) {
    if (typeof id === 'undefined') {
      return
    }
    const { data, code } = await wx.http.get(`/announcement/${id}`)
    if (code !== 10000) {
      return wx.showToast({
        title: '获取失败',
        icon: 'none'
      })
    }
    console.log(data, id)

    this.setData({
      detailList: data
    })
  }
})
